package com.springbootthymeleaf.controller;
import com.springbootthymeleaf.pojo.User;
import jakarta.servlet.http.HttpSession;

import org.springframework.boot.autoconfigure.security.SecurityProperties;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;


@Controller
public class IndexController {
    @RequestMapping({"/","/toIndex"})
    public String toIndex(Model model, HttpSession session){
        model.addAttribute("message","Hello ,how are you doing");
        model.addAttribute("result",100+200);//变量表达式
         model.addAttribute("user1",new User(1,785555));
         session.setAttribute("user2",new User(2,666777));
        return "index";


    }




}
